package com.mall.job;

import com.mall.db.domain.Coupons;
import com.mall.db.service.CouponsService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.PersistJobDataAfterExecution;

import javax.annotation.Resource;

@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class CouponLapseJob implements BaseJob{
    private int id;
    @Resource(name = "couponsService")
    private CouponsService cs;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
          Coupons c=new Coupons();
          c.setStatus(0);
          c.setId(id);
          cs.updateById(c);
    }
}
